using MediatR;
using TerritoryGame.Domain.ValueObjects;

namespace TerritoryGame.Application.Queries;

public record GetGameQuery : IRequest<GetGameResult?>
{
    public required string RoomCode { get; init; }
}

public record GetGameResult
{
    public required GameId GameId { get; init; }
    public required GameName Name { get; init; }
    public required int MaxPlayers { get; init; }
    public required GameDuration Duration { get; init; }
    public required string Status { get; init; }
    public required List<PlayerInfo> Players { get; init; }
    public required string? Password { get; init; }
    public required DateTime CreatedAt { get; init; }
    public required DateTime? StartedAt { get; init; }
    public required DateTime? EndedAt { get; init; }
}

public record PlayerInfo
{
    public required PlayerId Id { get; init; }
    public required string Nickname { get; init; }
    public required string Color { get; init; }
    public required double Area { get; init; }
    public required bool IsOwner { get; init; }
    public required bool IsConnected { get; init; }
}
